package com.example.forum.services;

import com.example.forum.model.Article;
import com.example.forum.model.ArticleReply;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public interface ArticleService {

    List<Article> selectAll ();

    List<Article> selectByBoardId (Long boardId);

    List<Article> selectByUserId (Long userId);

    @Transactional
    void create(Article article);

    Article selectDetailById(Long id);

    void modify(Long id, String title, String content);

    void thumbsUpById (Long id);

    @Transactional //事务管理
    void deleteById (Long id);

    List<ArticleReply> selectReplyByArticleId (Long articleId);

    Article selectById(Long id);

    void addReplyCount(Long articleId);
}
